package cn.com.dhcc.adam.se;

import java.util.Date;
import java.util.LinkedList;
import java.util.List;

public class ListTest {

	public static void main(String[] args){
		java.util.List<String> cols = new java.util.ArrayList<String>();
		cols.add("cedo");
		cols.add("root");
		cols.add("中文");
		cols.add("test");
		System.out.println(cols);
		cols.add(2,"Hello World!");
		System.out.println(cols);
		
		int total=1000000;
		for (int i = 0; i < total; i++) {
			cols.add("this is  :"+i);
		}
		
		int d = (int) (Math.random()*1000%total);
		System.out.println(new Date().getTime());
		System.out.println(cols.get(d));
		System.out.println(new Date().getTime());
		
		List<String> llist = new LinkedList<String>();
		for (int i = 0; i < total; i++) {
			llist.add("this is  :"+i);
		}

		int d2 = (int) (Math.random()*1000%total);
		System.out.println(new Date().getTime());
		System.out.println(cols.get(d2));
		System.out.println(new Date().getTime());
		System.out.println(cols.get(total/2));
		cols.remove(total/2);
		System.out.println(cols.get(total/2));
		
	}

}
